package cqupt.spark_log.fileio;

import java.io.File;
import java.io.FileFilter;

public class FileFilterMan implements FileFilter {
	private String rgex = ".*-\\d+-\\d+";
	public FileFilterMan() {
	}
	public FileFilterMan(String rgex) {
		this.rgex = rgex;
	}
	public boolean accept(File file) {
		if (file.isDirectory() && judgName(file)) {
			return true;
		}
		return false;
	}

	private boolean judgName(File file) {
		String name = file.getName();
		return name.matches(rgex);
	}
}
